<?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\LinkPager;
?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>线下活动</title>
    <!--<meta name="description" content="这是主页">-->
    <meta name="keywords" content="form">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href="css/chinaz.css">
    <link rel="stylesheet" href="css/amazeui.swiper.min.css">


    <link rel="stylesheet" href="css/index.css">
    <!--<link rel="stylesheet" href="css/amazeui.slick.min.css">
    -->
    <!--<link rel="icon" type="image/png" href="assets/i/favicon.png">
    -->
    <!--<link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
    -->
    <!--<meta name="apple-mobile-web-app-title" content="Amaze UI" />
    -->
    <link rel="stylesheet" href="assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="assets/css/layout.css"/>
    <!--<link rel="stylesheet" href="assets/css/admin.css">--></head>
<body>
<style>
    .objDetail {
        width: 23%;
        border-bottom: 1px solid #7c7c7c;
        margin-left: 2%;
        float: left;
        margin-bottom: 20px;
    }

    .am-pagination li a {
        border-radius: 4px;
        background-color: #dfe5e9;
        color: #7f8c8d;
    }
</style>
<!--<div style="background-color: #FFFFFF;height: 60px">-->
<!--    <img src="img/logo-06.png" id="layoutLogo" style="float: left;margin-left: 5%;margin-right: 30px">-->
<!---->
<!--    <div id='cssmenu' style="float: left">-->
<!--        <ul>-->
<!---->
<!--            <li>-->
<!--                <a href=-->
<!--                --><?//= Url::toRoute('index/show'); ?>
<!--                >首页</a>-->
<!--            </li>-->
<!---->
<!--            <li>-->
<!--                <a href=-->
<!--                --><?//= Url::toRoute('project/show'); ?>
<!--                >创业项目</a>-->
<!--            </li>-->
<!--            <li class=' has-sub'>-->
<!--                <a href=-->
<!--                --><?//= Url::toRoute('raised/show'); ?>
<!--                >项目聚幕</a>-->
<!--                <ul>-->
<!--                    <li class='has-sub sub-li'>-->
<!--                        <a href=-->
<!--                        --><?//= Url::toRoute('raised/show'); ?>
<!--                        >投资聚募</a>-->
<!--                    </li>-->
<!--                    <li class='has-sub sub-li'>-->
<!--                        <a href=-->
<!--                        --><?//= Url::toRoute('raised/select'); ?>
<!--                        >我要融资</a>-->
<!---->
<!--                    </li>-->
<!--                </ul>-->
<!--            </li>-->
<!--            <li class=' has-sub active'>-->
<!--                <a href=-->
<!--                --><?//= Url::toRoute('basic-service/show-activity'); ?>
<!--                >基础服务</a>-->
<!--                <ul>-->
<!--                    <li class='has-sub sub-li active'>-->
<!--                        <a href=-->
<!--                        --><?//= Url::toRoute('basic-service/show-activity'); ?>
<!--                        >线下活动</a>-->
<!--                    </li>-->
<!--                    <li class='has-sub sub-li'>-->
<!--                        <a href=-->
<!--                        --><?//= Url::toRoute('basic-service/show-information'); ?>
<!--                        >创业资讯</a>-->
<!--                    </li>-->
<!--                   <li class='has-sub sub-li'>-->
<!--                        <a href=-->
<!--                        --><?//= Url::toRoute('basic-service/show-business'); ?>
<!--                        >工商注册</a>-->
<!--                    </li>-->
<!--                    <li class='has-sub sub-li'>-->
<!--                        <a href=-->
<!--                        --><?//= Url::toRoute('basic-service/show-finance'); ?>
<!--                        >财务代办</a>-->
<!--                    </li>-->
<!--                    <li class='has-sub sub-li'>-->
<!--                        <a href=-->
<!--                        --><?//= Url::toRoute('basic-service/show-law'); ?>
<!--                        >法务咨询</a>-->
<!--                    </li>-->
<!--                </ul>-->
<!--            </li>-->
<!--        </ul>-->
<!--    </div>-->
<!--    <div class="isLogin">-->
<!--        <ul>-->
<!--            <li>-->
<!--                <img src="img/join.png">-->
<!--                <span>免费注册</span>-->
<!--            </li>-->
<!--            <li>-->
<!--                <img src="img/login.png" style="margin-top: -4px">-->
<!--                <span style="color: #3A99DB">登陆</span>-->
<!--            </li>-->
<!--        </ul>-->
<!--    </div>-->
<!--</div>-->
<div style="clear: both"></div>
<div class="contextDiv" style="padding-left: 4%;padding-right: 4%">
    <div style="text-align:center;display: inline-block;background-color: white;height: 60px;padding-top: 16px;width: 8%;border-top: 2px solid #3A99DB;color: #3A99DB">
        线下活动
    </div>
    <div style="width: 100%;background-color: white;">
        <hr data-am-widget="divider" style="margin-top: 0px;margin-bottom:10px;"
            class="am-divider am-divider-default"/>
        
        <?php foreach ($informations['informations'] as $information): ?>
            <div style="width: 100%;padding-right: 8px">
            <img src=
            <?= Html::encode($information->avatar) ?>
             style="width: 25%;float: left">

            <div style="width: 74%;float: left;margin-left: 1%"><b>
            <?= Html::encode($information->title) ?>
            </b>
                <br>
            <span style="font-size: 14px;line-height:0;color: #7c7c7c">
              <?= Html::encode($information->content) ?>
            </span>
            </div>
            <div>&nbsp;</div>
            <div style="clear: both;float: right;color: #B6c1c9;font-size: 14px;margin-top: -14px">
                <img src="img/clock.png" style="width: 18px;margin-top: -4px">
                <span style="margin-left: 4px">
                <?= Html::encode($information->createdDate) ?>
                </span>
                <img src="img/eyes.png" style="width: 18px;margin-top: -4px;margin-left: 20px">
                <span style="margin-left: 2px">
                <?= Html::encode($information->visitors) ?>
                </span>
            </div>
        </div>
        <hr data-am-widget="divider" style="margin-top: 8px;margin-bottom:10px;"
            class="am-divider am-divider-default"/>
        <?php endforeach; ?>
    </div>

    <div style="width: 100%;height: 2px;clear: both"></div>
    <div style="margin-top: 20px;text-align: center;padding-bottom: 10px">
        <ul class="am-pagination am-pagination-centered">
        <li><a href=
            <?= Url::toRoute(['basic-service/show-activity','page' => 1]); ?>
            >«</a></li>
            <li><a href=
            <?php
            if(1 <= $informations['pagination']->page+1-1) 
            echo Url::toRoute(['basic-service/show-activity','page' => $informations['pagination']->page+1-1]); 
            else
            echo Url::toRoute(['basic-service/show-activity','page' => 1]);
            ?>
            >‹</a></li>
            <?php
            //获取当前页数，默认为第1页
            $currentPage = Yii::$app->request->getQueryParam('page',1);
            for($i = $currentPage - 2; $i <= $informations['pagination']->pageCount && $i <= $currentPage + 2; $i++)
            {
                if($i >= 1)
                {
                    if($currentPage != $i)
                        echo '<li><a href='.
                    Url::toRoute(['basic-service/show-activity','page' => $i])
                    .'>'.$i.'</a></li>';
                    else
                        echo '<li class="am-active"><a href='.
                    Url::toRoute(['basic-service/show-activity','page' => $i])
                    .'>'.$i.'</a></li>';
                }
                
            }
            ?>
            <li><a href=
            <?php 
            if($informations['pagination']->pageCount >= $informations['pagination']->page+1+1)
            echo Url::toRoute(['basic-service/show-activity','page' => $informations['pagination']->page+1+1]);
            else
            echo Url::toRoute(['basic-service/show-activity','page' => $informations['pagination']->pageCount]);
            ?>
            >›</a></li>
            <li><a href=
            <?= Url::toRoute(['basic-service/show-activity','page' => $informations['pagination']->pageCount]); ?>
            >»</a></li>

        </ul>
    </div>
</div>
<!--<footer style="background-color: #FFFFFF;height: 100px;width: 100%;margin-bottom: 20px">-->
<!--    <img src="img/logo-06.png" class="layoutLogo"-->
<!--         style="float: left;margin-left: 5%;margin-top:12px;margin-right: 30px">-->
<!--    <ul class="footUl">-->
<!--        <li><a href="#">商务合作</a></li>-->
<!--        <li><a href="#">常见问题</a></li>-->
<!--        <li><a href="#">关于我们</a></li>-->
<!--        <li><a href="#">业务规划</a></li>-->
<!--        <li><a href="#">联系我们</a></li>-->
<!--        <li><a href="#">免责声明</a></li>-->
<!--    </ul>-->
<!--    <img src="img/erweima.jpg" style="width: 80px;float: right;margin-right: 5%;margin-top:18px">-->
<!--</footer>-->
</body>
<script src="assets/js/jquery.min.js"></script>
<script src="js/index.js"></script>
<!--<![endif]-->
<script src="assets/js/amazeui.min.js"></script>
<!--<script src="js/chinaz.js"></script>-->
<script src="js/amazeui.swiper.min.js"></script>
<!--<script src="js/slick.min.js"></script>
-->
<!--<script src="assets/js/app.js"></script>
-->
</html>